<script setup>
import { ref } from 'vue'
import Child from './components/Child.vue'
const childRef = ref(null)
const clickFn = () => {
  console.log(childRef.value.count)
  childRef.value.say()
}
</script>

<template>
  <div>爸爸</div>
  <div>儿子</div>
  <Child ref="childRef"></Child>
  <button @click="clickFn">儿子听我的</button>
</template>

<style scoped></style>
